//
//  NoCameralView.m
//  YSSmartHome
//
//  Created by yanghao on 2016/10/17.
//  Copyright © 2016年 yahaong. All rights reserved.
//

#import "NoCameralView.h"
#import "YHMarcros.h"

@interface NoCameralView ()
@property (nonatomic, strong)UIButton *addSceneBtn;
@property (nonatomic, strong)UILabel * tipsLabel;

@end
@implementation NoCameralView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setIcon:(NSString *)icon
{
    _icon = icon;
    [self.addSceneBtn setImage:[UIImage imageNamed:icon] forState:UIControlStateNormal];
}

- (void)setTitle:(NSString *)title
{
    _title = [title copy];
    self.tipsLabel.text  = title;
}
- (void)setupUI
{
    
    UIButton *addSceneBtn = [[UIButton alloc]init];
    addSceneBtn.userInteractionEnabled = NO;
    [self addSubview:addSceneBtn];
//    [addSceneBtn setImage:[UIImage imageNamed:@"security_icon_nodevice" ] forState:UIControlStateNormal];
    [addSceneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(kIphoneSize_Height(80));
        make.centerX.equalTo(self);
        make.size.equalTo(CGSizeMake(kIphoneSize_Widith(170), kIphoneSize_Height(98)));
    }];
    self.addSceneBtn = addSceneBtn;
    UILabel *tipsLabel = [[UILabel alloc]init];
    tipsLabel.font = [UIFont systemFontOfSize:14];
//    tipsLabel.text = @"     亲  你还未添加摄像头\n你可以点击“+”进行添加设置";
    tipsLabel.textColor =RGBColor(51, 51, 51);
    tipsLabel.numberOfLines = 2;
    [self addSubview:tipsLabel];
    [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(addSceneBtn.bottom).offset(20);
        make.centerX.equalTo(addSceneBtn);
    }];
    self.tipsLabel = tipsLabel;
}


@end
